@extends('admin.home.main')

@section('body')
<section id="main-content">

<section class="wrapper">
<h3>订单列表</h3>
<hr>
<div class="row mt">
  <div class="col-md-12">
  <form action="/admin/order/list" method="get">
    <select size="1" name="page_size" aria-controls="hidden-table-info" style="width:80px; height:34px; float:left; " class="form-control">
      <option value="0">请选择</option>
      @foreach($page_size_list as $ptm=>$pst)
        @if($pst == $page_size)
        <option value="{{$pst}}" selected="selected">{{$pst}}</option>
        @else
        <option value="{{$pst}}">{{$pst}}</option>
        @endif
      @endforeach
    </select>
    <input type="text" style="width:200px;float:left; margin-left:10px;" class="form-control"  placeholder="请输入电话或订单编号" name="keywords" id="keywords" value="{{$keywords}}">
    <button type="submit" id="search" style="float:left; margin-left:10px;" class="btn btn-success">搜索</button>
  </form>
  </div>
</div>

<!-- row -->
<div class="row mt">
  <div class="col-md-12">
    <div class="content-panel">
      <table class="table table-striped table-advance table-hover">
        <thead>
          <tr>
          	<th>#</th>
            <th>产品名称</th>
            <th>单价</th>
            <th>推荐人昵称</th>
            <th>买家昵称</th>
            <th>联系电话</th>
            <th>下单时间</th>
            <th>支付状态</th>
            <th>订单状态</th>
            <th>订单编号</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          @foreach($orderlist as $ost)
          <tr>
            <td>{{$ost->id}}</td>
            <td>
              @foreach($ost->product_list as $ptm=>$pst)
                {{$pst->product_id}}-{{$pst->product_name}}<br>
              @endforeach
            </td>
            <td>
              @foreach($ost->product_list as $ptm=>$pst)
              ￥{{$pst->price}}<br>
              @endforeach
            </td>
            <td>{{$ost->tmember_nick}}</td>
            <td>{{$ost->member_nick}}</td>
            <td>{{$ost->telephone}}</td>
            <td>{{$ost->add_date}}</td>
            <td>
              @if($ost->pay_status == 40)
                已付款
              @else
                未付款
              @endif
            </td>
            <td>
              @if($ost->composition_status == 0)
                已取消
              @elseif($ost->composition_status == 50)
                已完成
              @elseif($ost->composition_status == 40)
                已发货
              @elseif($ost->composition_status == 30)
                待发货
              @elseif($ost->composition_status == 60)
                已关闭
              @endif
            </td>
            <td>{{$ost->ordernum}}</td>
          	<td>
              <a href="/admin/order/vieworder/{{$ost->id}}">查看订单</a>
              @if($ost->status != 50)
              <a href="/admin/order/closeorder/{{$ost->id}}">关闭订单</a>
                @endif
            </td>
          </tr>
          @endforeach

        </tbody>
      </table>
    </div>
    <!-- /content-panel -->
    <div class="row-fluid">

      <div class="span6">
        <div class="dataTables_paginate paging_bootstrap pagination">
          <ul>{!! $orderlist->render() !!}</ul>
        </div>
      </div>
    </div>
  </div>
  <!-- /col-md-12 -->
 
</div>
<!-- /row -->
</section>
</section>
@endsection